package cn.ad.server.persistence.dao;

import cn.ad.server.domain.ad.GeoDistrict;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface GeoDistrictDao {
		@Results(value = { @Result(column = "id", property = "id", id = true),
			@Result(column = "english_name", property = "englishName"),
			@Result(column = "update_time", property = "updateTime") })
		@Select("select * from geo_district")
		List<GeoDistrict> findAll();
		
		@Results(value = { @Result(column = "id", property = "id", id = true),
				@Result(column = "english_name", property = "englishName"),
				@Result(column = "update_time", property = "updateTime") })
		@Select("select * from geo_district where id = #{value}")
		GeoDistrict findById(long id);
	
}
